package com.android.footprint;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import android.widget.Toast;

public class ConnReceiver extends BroadcastReceiver {
    private static final String TAG = "ConnReceiver";
    
    public static final String CONN_CHANGE_ACTION = "android.net.conn.CONNECTIVITY_CHANGE";
    
    private static int count = 0;
    
    private String starter = "system";
    
    public ConnReceiver() {
        
    }
    
    public ConnReceiver(String starter) {
        this.starter = starter;
    }

    @Override
    public void onReceive(Context context, Intent intent) {
        ++count;
        String hint = "connection changed, " + count + ", " + starter;
        Log.i(TAG, hint);
        Toast.makeText(context, hint, Toast.LENGTH_LONG).show();
    }

}
